<%@ page contentType="text/html;charset=gb2312"%> 
<%@ page import="com.telecom.cms.dao.*,com.telecom.cms.dbconnect.*,java.util.Enumeration,com.telecom.cms.dto.*"  %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>index.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <body>
	<%
	    Enumeration name = session.getAttributeNames();
			while (name.hasMoreElements()) {
				String na = (String) name.nextElement();
				session.removeAttribute(na);
			}
	    
		String MyUrl[]=request.getQueryString().split("&");

		String User_Id=request.getParameter("User_Id");
		String User_name=null; 
		String Latn_id=request.getParameter("Latn_id");
		String User_Auth=null;
		
		for (int i=0;i<MyUrl.length;i++)
		{
		  if (MyUrl[i].indexOf("User_Auth")>-1) 
		     User_Auth=MyUrl[i].substring(MyUrl[i].indexOf("User_Auth")+10);
		  if (MyUrl[i].indexOf("User_name")>-1) 
		     User_name=MyUrl[i].substring(MyUrl[i].indexOf("User_name")+10);
		}
		if(User_Auth!=null)
		User_Auth=Chinese.decode(User_Auth,"GB2312");
		if(User_name!=null)
		User_name=Chinese.decode(User_name,"GB2312");

		//if(Latn_id !=null){
		if(User_Id !=null&&User_name!=null&&Latn_id!=null&&User_Auth!=null){
			session.setAttribute("User_Id",User_Id);
			session.setAttribute("User_name",User_name);
			session.setAttribute("latnid",Latn_id);
			session.setAttribute("User_Auth",User_Auth);
			
			LOC_LATNDTO dto=new LOC_LATNDAO().findById(Latn_id);
			String latncd=dto.getLatn_cd();
			String latndesc=dto.getLatn_desc();
			session.setAttribute("latndesc",latndesc);
			session.setAttribute("latncd",latncd);
			
			//out.print(User_name+"<<");
			response.sendRedirect("segmentindex.jsp");
		}else{
			response.sendRedirect("http://133.0.177.7/tpifweb/login.do");
		}
	%>    
  </body>
</html:html>
